#include<stdio.h>
int factorial(int n)
{
    int sum = 1;
    int i = 1;
    for (i = 1; i <= n; i++)
    {
        sum *= i;
    }
    return sum;
}

int main()
{
    int n = 0;
    printf("输入一个数，算其的阶乘：\n");
    scanf("%d", &n);
    printf("%d\n", factorial(n));
    return 0;
}
